package com.example.doctorserver.controller;

import com.example.doctorserver.pojo.Cidetailedreport;
import com.example.doctorserver.response.ApiRestResponse;
import com.example.doctorserver.service.CiDetailedReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static com.example.doctorserver.response.TijianExceptionEnum.SYSTEM_ERROR;


@RestController
@RequestMapping("/ciDetailedReport")
public class CiDetailedReportController {

    @Autowired
    private CiDetailedReportService ciDetailedReportService;

    @PostMapping("/updateCiDetailedReport")
    public ApiRestResponse updateCDR(@RequestBody List<Cidetailedreport> arr){


        System.out.println(arr);

        int i=ciDetailedReportService.updateValue(arr);

        if (i==0)
        return ApiRestResponse.success(201);
        else
            return ApiRestResponse.success(200);
    }
}
